package com.foolishbird.sdk.params.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;



public class PopupConfig implements Parcelable {

    /**
     * 弹窗时间间隔，单位分钟，只在游客登录/一键登录/一键注册接口有用
     */
    @SerializedName("interval_times")
    private long intervalTimes;


    /**
     * 间隔时间单位，s为秒 m为分
     */
    @SerializedName("interval_unit")
    private String intervalUnit;

    /**
     * 1 可关闭 2 不可关闭
     */
    @SerializedName("u_idcard_popup_close")
    private int isIdcardPopupCloseEnable;
    /**
     * 1:弹窗 2:不弹窗
     */
    @SerializedName("u_idcard_popup")
    private int isIdcardPopup = 1;
    /**
     * 1:弹窗 2:不弹窗
     */
    @SerializedName("u_phone_popup")
    private int isPhonePopup;

    /**
     * 游戏内部公告推送通知
     * 1:弹窗 2:不弹窗
     */
    @SerializedName("u_notice_popup")
    private int isNoticePopup;

    /**
     * 公告弹窗数据
     */
    @SerializedName("u_notice_data")
    private Popup noticePopup;

    /**
     * 实名认证副标题信息
     */
    @SerializedName("u_idcard_msg")
    private String idcardMsg;

    @SerializedName("notice_map")
    private ArrayList<GameNoticeModel> gameNoticeList;

    /*
     * 公告弹窗的ui风格，1|仙侠风格 2|传奇风格  （2套前端ui效果）
     */
    @SerializedName("notice_ui_type")
    private int noticeUIType;


    public long getIntervalTimes() {
        return intervalTimes;
    }

    public void setIntervalTimes(long intervalTimes) {
        this.intervalTimes = intervalTimes;
    }

    public boolean isIdcardPopupCloseEnable() {
        return isIdcardPopupCloseEnable == 1;
    }

    public void setIdcardPopupCloseEnable(int idcardPopupCloseEnable) {
        this.isIdcardPopupCloseEnable = idcardPopupCloseEnable;
    }

    public boolean isIdcardPopup() {
        return isIdcardPopup == 1;
    }

    public void setIdcardPopup(int idcardPopup) {
        this.isIdcardPopup = idcardPopup;
    }

    public boolean isPhonePopup() {
        return isPhonePopup == 1;
    }

    public void setPhonePopup(int phonePopup) {
        this.isPhonePopup = phonePopup;
    }

    public boolean isNoticePopup() {
        return this.isNoticePopup == 1;
    }

    public void setNoticePopup(int noticePopup) {
        this.isNoticePopup = noticePopup;
    }

    public Popup getNoticePopup() {
        return noticePopup;
    }

    public void setNoticePopup(Popup noticePopup) {
        this.noticePopup = noticePopup;
    }

    public String getIdcardMsg() {
        return idcardMsg;
    }

    public void setIdcardMsg(String idcardMsg) {
        this.idcardMsg = idcardMsg;
    }

    public int getNoticeUIType() {
        return noticeUIType;
    }

    public void setNoticeUIType(int noticeUIType) {
        this.noticeUIType = noticeUIType;
    }

    public String getIntervalUnit() {
        return intervalUnit;
    }

    public void setIntervalUnit(String intervalUnit) {
        this.intervalUnit = intervalUnit;
    }

    public PopupConfig() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.intervalTimes);
        dest.writeInt(this.isIdcardPopupCloseEnable);
        dest.writeInt(this.isIdcardPopup);
        dest.writeInt(this.isPhonePopup);
        dest.writeInt(this.isNoticePopup);
        dest.writeParcelable(this.noticePopup, flags);
        dest.writeString(this.idcardMsg);
        dest.writeList(this.gameNoticeList);
        dest.writeInt(this.noticeUIType);
        dest.writeString(this.intervalUnit);
    }

    protected PopupConfig(Parcel in) {
        this.intervalTimes = in.readLong();
        this.isIdcardPopupCloseEnable = in.readInt();
        this.isIdcardPopup = in.readInt();
        this.isPhonePopup = in.readInt();
        this.isNoticePopup = in.readInt();
        this.noticePopup = in.readParcelable(Popup.class.getClassLoader());
        this.idcardMsg = in.readString();
        in.readList(this.gameNoticeList,GameNoticeModel.class.getClassLoader());
        this.noticeUIType = in.readInt();
        this.intervalUnit = in.readString();
    }

    public static final Creator<PopupConfig> CREATOR = new Creator<PopupConfig>() {
        @Override
        public PopupConfig createFromParcel(Parcel source) {
            return new PopupConfig(source);
        }

        @Override
        public PopupConfig[] newArray(int size) {
            return new PopupConfig[size];
        }
    };

    public ArrayList<GameNoticeModel> getGameNoticeList() {
        return gameNoticeList;
    }

    public void setGameNoticeList(ArrayList<GameNoticeModel> gameNoticeList) {
        this.gameNoticeList = gameNoticeList;
    }
}
